package com.zxy.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zxy.common.result.PageResult;
import com.zxy.common.result.Result;
import com.zxy.pojo.entity.BusinessRecord;
import com.zxy.pojo.entity.CustomerClue;

import com.zxy.pojo.dto.BusinessQueryDTO;
import com.zxy.pojo.vo.CustomerDetailVO;

import java.util.List;
import java.util.Map;

public interface OpportunityService extends IService<CustomerClue> {
    /**
     * 分页查询商机
     * @param query
     * @return
     */
    PageResult listByPage(BusinessQueryDTO query);



    /**
     * 保存商机
     * @param customerClue
     * @return
     */
    boolean saves(CustomerClue customerClue);


    /**
     * 商机记录列表
     * @param businessId
     * @return
     */
    List<BusinessRecord> getListByBusinessId(Long businessId);



    /**
     * 商机详情
     * @param id
     * @return
     */
    CustomerDetailVO getByIds(Long id);




    /**
     * 商机跟进
     * @param record
     * @return
     */
    boolean addRecord(BusinessRecord record);

    /**
     * 商机分配
     * @param ids
     * @param userId
     * @return
     */
    String assignment(Long[] ids, Long userId);

    /**
     * 商机回退
     * @param id
     * @param type
     * @return
     */
    boolean backOperation(Long id, Integer type);

    /**
     * 商机获取
     * @param businessId 商机ID
     * @return
     */
    Result gainBusiness(Long businessId);

    /**
     * 商机合同变更
     * @param id
     * @return
     */
    void changeContract(Long id);
}
